import { sendCodeApi } from '@/server/modules/user'
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit'

// 获得验证码
export const getVerifyCodeAction = createAsyncThunk(
  'getVerifyCodeAction',
  async (phone: number) => {
    const res = await sendCodeApi({phone})
    console.log(res);
  }
)
interface IState {
  code: string
}
const initialState: IState = {
  code: ''
}
export const userSlice = createSlice({
  name: 'user',
  initialState,
  reducers: {}
})

export default userSlice.reducer
